(C) 1996 AROS - The Amiga Replacement OS


NAME
APTR SetFunction()
SYNOPSIS
struct Library * library
LONG funcOffset
APTR newFunction

LOCATION
In SysBase at offset 70
FUNCTION
Replaces a certain jumptable entry with another one. This function only Forbid()s taskswitching but doesn't Disable() interrupts. You have to do your own arbitration for functions which are callable from interrupts.

INPUTS
library
Pointer to library structure.
funcOffset
Offset of the jumpvector from the library base address in bytes.
newFunction
New jumptable entry (pointer to the new function).
RESULT
Old jumptable entry (pointer to the old function).

NOTES
While it's more or less safe to patch a library vector with SetFunction() it's not possible to safely remove the patch later. So don't use this function if it can be avoided.

EXAMPLE
BUGS
On native builds, this contains a hack to fix dos.library/ramlib attempts to setfunction exec functions. Because of this, a funcOffset of more than 32 kB be truncated. This hack will also fix other programs only using the lower 16 bits of funcOffset and leaving garbage in the upper 16 bits. These programs should be fixed.

SEE ALSO
MakeLibrary(), MakeFunctions(), SumLibrary().
INTERNALS
HISTORY
12.05.1997 aros
Fixed all headers
26.03.1997 ldp
Coded new AROSfA section, so gcc doesn't generate 64-bit multiply instructions anymore. They caused it to fail on a 68060.
06.03.1997 ldp
Removed log.

Typos.

28.02.1997 ldp
AROSfA: Refine way to sign-extend from 16 to 32 bits
26.02.1997 ldp
AROSfA: added hack to keep dos.library patches working. See source for extensive comments.
01.01.1997 ldp
Committed Amiga native (support) code

Changed clib to proto

10.12.1996 aros
Moved all #include's in the first column so makedepend can see it.
24.10.1996 aros
Named all macros which the user/developer can use as "AROS".

For some strange reason, GCC produces incorrect code for "x /= -5;". "x = (-x) / 5" works...

23.10.1996 aros
Use the respective macros to access and manipulate a libraries' jumptable
19.10.1996 aros
Include <aros/machine.h> instead of machine.h
13.08.1996 digulla
Replaced __AROS_LA by __AROS_LHA Replaced some __AROS_LH*I by __AROS_LH* Sorted and added includes
01.08.1996 digulla
Added standard header for all files
01.08.1996 digulla
Added copyright notics and made headers conform
28.07.1996 digulla
Initial revision
28.07.1996 digulla
First CVS version of AROS